<?php

$strScreenName = 'Search';
//$strQueryName = 'qrySearchProduct_Customer';
$strFormName = 'frmSearchProduct';

$txtProduct = stripslashes($txtProduct);
$txtOwnProductCode = stripslashes($txtOwnProductCode);
$cboCategory = stripslashes($cboCategory);
$cboSubCategory = stripslashes($cboSubCategory);
if($strStyleSheet == TRUE){
	echo "<table class='Normal' border='0' align='left'>";
}		
echo "
 <tr>
     <td>
         <table  width='100%' cellpadding='0' cellspacing='0' border='0' class='Normal' align='center'>
     		<tr align='left'>
         		<td align='left' colspan='2'>
             		<H2>Product Search</H2>
		         </td>
		     </tr>
";
echo (StartForm($strScreenName, "post", $strQueryName,array('strDirection'=>'NoSearch'),"","",$strFormName,"",""));

echo "
		     <tr>
		        <td align='right' width='200'>
		             <b>Product :&nbsp;</b>
				</td>
				<td align='left' width='295'>
		             <input type=\"text\" name=\"txtProduct\" value = \"$txtProduct\" size= \"40\" maxlength=\"100\">
		         </td>
		     </tr>
";

//echo "
     //<tr  align='left'>
         //<td align='left' colspan='2'>
             //<b>Description :</b><br/>
             //<textarea cols=60 rows=6 name=\"txtDescription\">$txtDescription</textarea>
         //</td>
     //</tr>
//";

echo "
     <tr>
        <td align='right'>
             <b>Product Code :&nbsp;</b>
		</td>
		<td align='left'>
             <input type=\"text\" name=\"txtOwnProductCode\" value = '$txtOwnProductCode' size= \"20\" maxlength=\"50\">
         </td>
     </tr>


     <tr align='left'>
         <td align='right'>
             <b>Category :&nbsp;</b><br/>
         </td>
         <td align='left'>";
		 //							$strFormName.ACTION.value='';
		 	$strRefresh = "$strFormName.SCREEN.value='Search';
							$strFormName.submit()";
             CreateDropDown("cboCategory", "SELECT * FROM tblCategory ORDER BY 2", $strRefresh, $cboCategory,"[Any Category]");
echo "
         </td>
     </tr>";
	 
	 if ($cboCategory){
		echo "
		     <tr align='left'>
		         <td align='right'>
		             <b>Sub Category :&nbsp;</b><br/>
		         </td>
		         <td align='left'>";
		             CreateDropDown("cboSubCategory", "SELECT ID, SubCategory FROM tblSubCategory WHERE Category = '$cboCategory' ORDER BY 2", $strRefresh, $cboSubCategory,"[Any Sub-category]");
		echo "
		         </td>
		     </tr>";
	}
/*
     <tr>
         <td align='left' colspan='1'>
             <b>Unit Retail Price (Including Vat) :&nbsp;</b>
         </td>
         <td align='right' colspan='1'>
             <input type=\"text\" name=\"txtUnitPrice\" value = '$txtUnitPrice' size= \"16\" maxlength=\"16\">
         </td>
     </tr>
*/

echo "
     <tr align='left'>
         <td align='right'>
             <b>Promotional Item :&nbsp;</b><br/>
         </td>
		<td align='left'>
                 <input type=\"checkbox\" name=\"chkPromotionalItem\">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='2'>
             <input type='image' src='./images".SITE_SUFFIX."/search.gif' alt='search' onClick=\"$strFormName.strDirection.value='First';$strFormName.submit()\">
         </td>
     </tr>
	 </form>
	 ";

	 echo "
	 

         </table>
     </td>
</tr>
<tr>
	<td>";
	//echo "strDirection $strDirection";
	
		if(($strDirection == "NoSearch") ||($strDirection == "")){
		}else{
			include ($SCREEN_LOCATION. "/screen/SearchResults");
		}
		
echo "
	</td>
</tr>
     
";	   
if($strStyleSheet == TRUE){
	echo "</table>";
}	
?>
